<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%@ page import="java.util.Iterator"%><%@ page import="java.util.Arrays"%>
<%@ page contentType="application/json;charset=UTF-8" language="java" %>
<%
    Map<String,String> result = new HashMap<>();
    Iterator<Map.Entry<String,String[]>> each = request.getParameterMap().entrySet().iterator();
    String action = null;

    while (each.hasNext()) {
        Map.Entry<String,String[]> got = each.next();
        if (got.getValue()[0].equals("")) ;
        else if (got.getKey().equals("action")){
            action = got.getValue()[0];
        } else result.putIfAbsent(got.getKey(),got.getValue()[0]);
    }

    request.setAttribute("sqlParam",result);
    request.getRequestDispatcher(action+".jsp").forward(request,response);
%>